import { CSSProperties } from 'react';

interface TableActionItemBase {
  text: string;
  disable?: boolean;
  key?: string;
  loading?: boolean;
}

export type TableActionClick = TableActionItemBase & {
  onClick: () => void;
};

export type TableActionConfirm = TableActionItemBase & {
  confirm: {
    onClick: () => void;
    title?: string;
  };
};

export type TableActionItem = TableActionClick | TableActionConfirm;

export interface TableActionProps {
  actions: TableActionItem[];
  className?: string;
  style?: CSSProperties;
}
